<div id="container">
    <div class="container-left">
        <h3>Create new category</h3>
        <form method="post" id="submit" name="submit">
            <div class="user-item">
                <label class="label-user">Title</label>
                <input id="category_title" name="title" style="border: 1px solid #ccc; margin-bottom: 0" type="text">
                <label style="display: none" class="error-notice category-title-error">Chưa nhập tiêu đề</label>
            </div>

            <div class="user-item">
                <label class="label-user">Position</label>
                <input name="position" style="border: 1px solid #ccc" type="text" placeholder="0">
            </div>

            <div class="user-item">
                <label class="label-user">Parent category</label>
                <select name="parent" style="border: 1px solid #ccc">
                    <option value="0">---</option>
                    <?php
                        foreach($parent_category as $v){
                            echo '<option value="'.$v['cid'].'">'.$v['category_title'].'</option>';
                        }
                    ?>
                </select>
            </div>

            <div class="user-item">
                <label class="label-user">Description</label>
                <textarea name="description"></textarea>
            </div>

            <div class="user-item">
                <input class="button-item" onclick="createCategory();" type="button" value="Ok">
            </div>
        </form>
    </div>
    <div class="container-right">
        <h3>Categories</h3>

        <div id="tree" class="tree tree-unselectable">
            <?php
                for($i = 0; $i < sizeof($data); $i++){
                    ?>
                        <div class="tree-folder" style="display: block;">
                            <div class="tree-folder-header">
                                <i class="red icon-folder-open"></i>
                                <div class="tree-folder-name"><?php echo $data[$i]['category_title']; ?></div>
                                <div class="tree-folter-option">
                                    <input cid="" class="tree-position" type="text" value="">
                                    <span><a title="Chỉnh sửa" href=""><i class="icon-cog"></i> Edit</a></span>
                                    <span cid="" onclick=""><i class="icon-remove"></i> Remove</span>
                                </div>
                            </div>
                            <?php
                                if(isset($data[$i]['children'])){
                                    foreach($data[$i]['children'] as $v){
                                        ?>
                                            <div class="tree-folder-content" style="display: block;">
                                                <div class="tree-folder" style="display: block;">
                                                    <div class="tree-folder-header">
                                                        <div class="tree-folder-name"><?php echo $v['category_title']; ?></div>
                                                        <div class="tree-folter-option">
                                                            <input cid="" class="tree-position" type="text" value="">
                                                            <span><a title="Chỉnh sửa" href=""><i class="icon-cog"></i> Edit</a></span>
                                                            <span cid="" ><i class="icon-remove"></i> Remove</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php
                                    }
                                }
                            ?>
                        </div>
                    <?php
                }
            ?>
                <!--<div class="tree-folder" style="display: block;">
                    <div class="tree-folder-header">
                        <i class="red icon-folder-open"></i>
                        <div class="tree-folder-name">aaaaaaaaa</div>
                        <div class="tree-folter-option">
                            <input cid="" class="tree-position" type="text" value="">
                            <span><a title="Chỉnh sửa" href=""><i class="icon-cog"></i> Edit</a></span>
                            <span cid="" onclick=""><i class="icon-remove"></i> Remove</span>
                        </div>
                    </div>

                        <div class="tree-folder-content" style="display: block;">
                            <div class="tree-folder" style="display: block;">
                                <div class="tree-folder-header">
                                    <div class="tree-folder-name">assssssssss</div>
                                    <div class="tree-folter-option">
                                        <input cid="" class="tree-position" type="text" value="">
                                        <span><a title="Chỉnh sửa" href=""><i class="icon-cog"></i> Edit</a></span>
                                        <span cid="" ><i class="icon-remove"></i> Remove</span>
                                    </div>
                                </div>
                            </div>

                        </div>
                </div>-->
        </div>
    </div>
</div>
